﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DeltaPlcSystem
{
    public partial class TimeForm : Form
    {
        public delegate void TimeDele(int mode);
        public event TimeDele TimeEvent;
        int model = 0;

        public TimeForm(int mode)
        {
            InitializeComponent();
            MaximizeBox = false;
            model = mode;
            if (mode == 0)
            {
                Text = "上传时间更新";
                uiTextBox1.Text = Form1.UpTime.ToString();
            }
            else
            {
                Text = "TBS时间更新";
                uiTextBox1.Text = Form1.TbsTime.ToString();
            }
        }

   

        private void uiButton1_Click(object sender, EventArgs e)
        {
            try
            {
                if (model == 0)
                {
                    Form1.UpTime = int.Parse(uiTextBox1.Text);
                }
                else
                    Form1.TbsTime = int.Parse(uiTextBox1.Text);

                TimeEvent(model);


                MessageBox.Show("更新成功");

                this.Close();
            }
            catch { }
        }


      
    }
}
